﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadGridAutomaticCrudOperations.aspx.cs"
    Inherits="RadGridAutomaticCrudOperations"  MasterPageFile="~/Rad.Master" %>

   <%@ Register assembly="Telerik.OpenAccess.Web" namespace="Telerik.OpenAccess" tagprefix="telerik" %>

   <asp:Content ID="ContentHeader" ContentPlaceHolderID="head" runat="server">
        <style type="text/css">
        .MyImageButton
        {
            cursor: hand;
        }
        .EditFormHeader td
        {
            font-size: 14px;
            padding: 4px !important;
            color: #0066cc;
        }
    </style>
   </asp:Content> 
   <asp:Content ID="PageContent" ContentPlaceHolderID="ContentPlaceHolderPageContent" runat="server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
        <telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"
            AllowSorting="True" AllowAutomaticInserts="True" 
            AllowAutomaticUpdates="True" AllowPaging="True" 
            DataSourceID="OpenAccessDataSource1" OnItemUpdated="RadGrid1_ItemUpdated" 
            OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"
            OnDataBound="RadGrid1_DataBound" AutoGenerateDeleteColumn="True" 
            AutoGenerateEditColumn="True" CellSpacing="0">
            <pagerstyle mode="NextPrevAndNumeric" />
            <mastertableview width="100%" commanditemdisplay="TopAndBottom" datakeynames="CategoryId" datasourceid="OpenAccessDataSource1"
                horizontalalign="NotSet" editmode="InPlace" autogeneratecolumns="False">
                <commanditemsettings exporttopdftext="Export to PDF" />
                <rowindicatorcolumn filtercontrolalttext="Filter RowIndicator column">
                </rowindicatorcolumn>
                <expandcollapsecolumn filtercontrolalttext="Filter ExpandColumn column">
                </expandcollapsecolumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="CategoryId" DataType="System.Int32" 
                        FilterControlAltText="Filter CategoryId column" HeaderText="CategoryId" 
                        SortExpression="CategoryId" UniqueName="CategoryId" ReadOnly="true" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CategoryName" 
                        FilterControlAltText="Filter CategoryName column" HeaderText="CategoryName" 
                        SortExpression="CategoryName" UniqueName="CategoryName">
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings>
                   <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <formmaintablestyle backcolor="White" cellpadding="3" cellspacing="0" 
                        width="100%" />
                    <formcaptionstyle cssclass="EditFormHeader" />
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                        Width="100%" />
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton" 
                        UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                </EditFormSettings>
            </mastertableview>
            <filtermenu enableimagesprites="False">
            </filtermenu>
            <headercontextmenu cssclass="GridContextMenu GridContextMenu_Default">
            </headercontextmenu>
        </telerik:RadGrid>
        <telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server" 
            ObjectContextProvider="RadControlsWithMasterPage.EntitiesModel, RadControlsWithMasterPage" 
            TypeName="RadControlsWithMasterPage.Category">
        </telerik:OpenAccessDataSource>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>
    </telerik:RadAjaxPanel>
  </asp:Content>

